import Vue from "vue";
import Router from "vue-router";
import LawMonitoring from "./lawMonitoring";
import UserManagement from "./userManagement";
import Supervisory from "./Supervisory";
import ProtectionSurvey from "./ProtectionSurvey"
Vue.use(Router);

// 后台公共布局模块
const ContainerBackstage = () =>
  import(/* webpackChunkName: "Container" */ "../components/Container/ContainerBackstage.vue");
const Page404 = () =>
  import(/* webpackChunkName: "404" */ "../views/404/404.vue");
const Login = () =>
  import(/* webpackChunkName: "Login" */ "../views/Login/Login.vue");

export default new Router({
  routes: [
    {
      path: "/",
      redirect: "/newFiles",
      show: false
    },
    {
      path: "/lawMonitoring",
      component: ContainerBackstage,
      show: true,
      list: true,
      meta: {
        title: "异常巡查",
        roles: ["admin"],
        icon: "iconfont icon-zhifajuanzong"
      },
      children: LawMonitoring
    },
    {
      path: "/protectionSurvey",
      component: ContainerBackstage,
      show: true,
      list: true,
      meta: {
        title: "环保调查",
        roles: ["admin"],
        icon: "iconfont icon-tiaocha1"
      },
      children: ProtectionSurvey
    },
    {
      path: "/supervisionCommand",
      component: ContainerBackstage,
      show: true,
      list: true,
      meta: {
        title: "监督指挥",
        roles: ["admin"],
        icon: "iconfont icon-jichazhifa"
      },
      children: Supervisory
    },
    {
      path: "/userManagement",
      component: ContainerBackstage,
      show: true,
      list: true,
      meta: {
        title: "用户管理",
        roles: ["admin"],
        icon: "iconfont icon-yonghuguanli"
      },
      children: UserManagement
    },
    {
      path: "/login",
      component: Login,
      show: false,
      meta: {
        title: "登录页"
      }
    },
    {
      path: "/404",
      component: Page404,
      hidden: false
    },
    {
      path: "*",
      redirect: "/404",
      // component: Page404,
      show: false
    }
  ]
});
